<template>
    <router-view></router-view>
</template>

<script lang="js">
// import { contestStore } from './stores/contest';
// import { storeToRefs } from 'pinia';
// import { watch } from 'vue';

export default {
    name: 'App',
    components: {},
    setup() {
        // const store = contestStore();
        // const { logo, name } = storeToRefs(store);

        // // 监听logo变化并更新favicon
        // watch(logo, (newLogo) => {
        //     if (newLogo) {
        //         const favicon = document.querySelector('link[rel="icon"]');
        //         favicon.href = newLogo;
        //     }
        // });

        // // 监听name变化并更新网页标题
        // watch(name, (newName) => {
        //     document.title = newName || 'SparkStack一体式平台';
        // });

        return {};
    },
    data() {
        return {};
    },
    created() {
        document.addEventListener('backbutton', this.goBack); // 监听移动端设备的后退按钮
    },
    mounted() {},
    updated() {},
    unmounted() {
        document.removeEventListener('backbutton', this.goBack); // 页面销毁时移除监听
    },
    methods: {
        // 用户在移动端设备点击后退按钮时，返回上一条路由
        goBack() {
            this.$router.go(-1);
        }
    }
};
</script>

<style scoped>
:deep(::-webkit-scrollbar) {
    display: none !important; /* 隐藏所有元素滚动条，且优先级最高 */
}
</style>
